package db_main

import (
	"fmt"
	"longmen/server/pkg/common/helper/util"
	"longmen/server/pkg/db/mysql"
	"longmen/server/pkg/db/mysql/models/models_main"
)

func GetAnchorLevelRules() ([]*models_main.AnchorLevelRule, error) {
	fName := "GetAnchorLevelRules"
	o := make([]*models_main.AnchorLevelRule, 0)
	table := mysql.GetRTable(&models_main.AnchorLevelRule{})
	err := table.Order("level ASC").Find(&o).Error
	if err != nil {
		err = fmt.Errorf("%s%s", util.Convert(fName), err.Error())
	}
	return o, err
}
